home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / vim / src / cmdtab.h < prev    next >
Text File  |  1995-03-09  |  12KB  |  338 lines

  1. /* vi:ts=4
  2.  *
  3.  * VIM - Vi IMproved
  4.  *
  5.  * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  6.  *                            Tim Thompson            twitch!tjt
  7.  *                            Tony Andrews            onecom!wldrdg!tony 
  8.  *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  9.  */
  10.  
  11. /*
  12.  * THIS FILE IS AUTOMATICALLY PRODUCED - DO NOT EDIT
  13.  */
  14.  
  15. #define RANGE    0x01            /* allow a linespecs */
  16. #define BANG    0x02            /* allow a ! after the command name */
  17. #define EXTRA    0x04            /* allow extra args after command name */
  18. #define XFILE    0x08            /* expand wildcards in extra part */
  19. #define NOSPC    0x10            /* no spaces allowed in the extra part */
  20. #define    DFLALL    0x20            /* default file range is 1,$ */
  21. #define NODFL    0x40            /* do not default to the current file name */
  22. #define NEEDARG    0x80            /* argument required */
  23. #define TRLBAR    0x100            /* check for trailing vertical bar */
  24. #define REGSTR    0x200            /* allow "x for register designation */
  25. #define COUNT    0x400            /* allow count in argument, after command */
  26. #define NOTRLCOM 0x800            /* no trailing comment allowed */
  27. #define ZEROR    0x1000            /* zero line number allowed */
  28. #define USECTRLV 0x2000            /* do not remove CTRL-V from argument */
  29. #define NOTADR    0x4000            /* number before command is not an address */
  30. #define FILES    (XFILE + EXTRA)    /* multiple extra files allowed */
  31. #define WORD1    (EXTRA + NOSPC)    /* one extra word allowed */
  32. #define FILE1    (FILES + NOSPC)    /* 1 file allowed, defaults to current file */
  33. #define NAMEDF    (FILE1 + NODFL)    /* 1 file allowed, defaults to "" */
  34. #define NAMEDFS    (FILES + NODFL)    /* multiple files allowed, default is "" */
  35.  
  36. /*
  37.  * This array maps ex command names to command codes. The order in which
  38.  * command names are listed below is significant -- ambiguous abbreviations
  39.  * are always resolved to be the first possible match (e.g. "r" is taken
  40.  * to mean "read", not "rewind", because "read" comes before "rewind").
  41.  * Not supported commands are included to avoid ambiguities.
  42.  */
  43. static struct
  44. {
  45.     char_u    *cmd_name;    /* name of the command */
  46.     short     cmd_argt;    /* command line arguments permitted/needed/used */
  47. } cmdnames[] =
  48. {
  49.     {(char_u *)"append",        BANG+RANGE+TRLBAR},            /* not supported */
  50. #define CMD_append 0
  51.     {(char_u *)"all",            TRLBAR},
  52. #define CMD_all 1
  53.     {(char_u *)"abbreviate",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  54. #define CMD_abbreviate 2
  55.     {(char_u *)"args",            RANGE+NOTADR+BANG+NAMEDFS},
  56. #define CMD_args 3
  57.     {(char_u *)"argument",        BANG+RANGE+NOTADR+COUNT+EXTRA},
  58. #define CMD_argument 4
  59.     {(char_u *)"buffer",        RANGE+NOTADR+COUNT+TRLBAR},
  60. #define CMD_buffer 5
  61.     {(char_u *)"ball",            TRLBAR},
  62. #define CMD_ball 6
  63.     {(char_u *)"buffers",        TRLBAR},
  64. #define CMD_buffers 7
  65.     {(char_u *)"bdelete",        BANG+RANGE+NOTADR+COUNT+EXTRA+TRLBAR},
  66. #define CMD_bdelete 8
  67.     {(char_u *)"bunload",        BANG+RANGE+NOTADR+COUNT+EXTRA+TRLBAR},
  68. #define CMD_bunload 9
  69.     {(char_u *)"bmodified",        RANGE+NOTADR+COUNT+TRLBAR},
  70. #define CMD_bmodified 10
  71.     {(char_u *)"bnext",            RANGE+NOTADR+COUNT+TRLBAR},
  72. #define CMD_bnext 11
  73.     {(char_u *)"bNext",            RANGE+NOTADR+COUNT+TRLBAR},
  74. #define CMD_bNext 12
  75.     {(char_u *)"bprevious",        RANGE+NOTADR+COUNT+TRLBAR},
  76. #define CMD_bprevious 13
  77.     {(char_u *)"brewind",        RANGE+TRLBAR},
  78. #define CMD_brewind 14
  79.     {(char_u *)"blast",            RANGE+TRLBAR},
  80. #define CMD_blast 15
  81.     {(char_u *)"change",        BANG+RANGE+COUNT+TRLBAR},    /* not supported */
  82. #define CMD_change 16
  83.     {(char_u *)"cabbrev",        EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  84. #define CMD_cabbrev 17
  85.     {(char_u *)"cc",            TRLBAR+WORD1+BANG},
  86. #define CMD_cc 18
  87.     {(char_u *)"cd",            NAMEDF+TRLBAR},
  88. #define CMD_cd 19
  89.     {(char_u *)"center",        TRLBAR+RANGE+EXTRA},
  90. #define CMD_center 20
  91.     {(char_u *)"cf",            TRLBAR+FILE1+BANG},
  92. #define CMD_cf 21
  93.     {(char_u *)"chdir",            NAMEDF+TRLBAR},
  94. #define CMD_chdir 22
  95.     {(char_u *)"cl",            TRLBAR},
  96. #define CMD_cl 23
  97.     {(char_u *)"close",            BANG+TRLBAR},
  98. #define CMD_close 24
  99.     {(char_u *)"cmap",            BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  100. #define CMD_cmap 25
  101.     {(char_u *)"cn",            TRLBAR+WORD1+BANG},
  102. #define CMD_cn 26
  103.     {(char_u *)"cnoremap",        BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  104. #define CMD_cnoremap 27
  105.     {(char_u *)"cnoreabbrev",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  106. #define CMD_cnoreabbrev 28
  107.     {(char_u *)"copy",            RANGE+EXTRA+TRLBAR},
  108. #define CMD_copy 29
  109.     {(char_u *)"cp",            TRLBAR+WORD1+BANG},
  110. #define CMD_cp 30
  111.     {(char_u *)"cq",            TRLBAR+BANG},
  112. #define CMD_cq 31
  113.     {(char_u *)"cunmap",        BANG+EXTRA+TRLBAR+USECTRLV},
  114. #define CMD_cunmap 32
  115.     {(char_u *)"cunabbrev",        EXTRA+TRLBAR+USECTRLV},
  116. #define CMD_cunabbrev 33
  117.     {(char_u *)"delete",        RANGE+REGSTR+COUNT+TRLBAR},
  118. #define CMD_delete 34
  119.     {(char_u *)"display",        TRLBAR},
  120. #define CMD_display 35
  121.     {(char_u *)"digraphs",        EXTRA+TRLBAR},
  122. #define CMD_digraphs 36
  123.     {(char_u *)"edit",            BANG+FILE1},
  124. #define CMD_edit 37
  125.     {(char_u *)"ex",            BANG+FILE1},
  126. #define CMD_ex 38
  127.     {(char_u *)"exit",            BANG+FILE1+DFLALL+TRLBAR},
  128. #define CMD_exit 39
  129.     {(char_u *)"file",            FILE1+TRLBAR},
  130. #define CMD_file 40
  131.     {(char_u *)"files",            TRLBAR},
  132. #define CMD_files 41
  133.     {(char_u *)"global",        RANGE+BANG+EXTRA+DFLALL},
  134. #define CMD_global 42
  135.     {(char_u *)"help",            TRLBAR},
  136. #define CMD_help 43
  137.     {(char_u *)"insert",        BANG+RANGE+TRLBAR},            /* not supported */
  138. #define CMD_insert 44
  139.     {(char_u *)"iabbrev",        EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  140. #define CMD_iabbrev 45
  141.     {(char_u *)"imap",            BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  142. #define CMD_imap 46
  143.     {(char_u *)"inoremap",        BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  144. #define CMD_inoremap 47
  145.     {(char_u *)"inoreabbrev",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  146. #define CMD_inoreabbrev 48
  147.     {(char_u *)"iunmap",        BANG+EXTRA+TRLBAR+USECTRLV},
  148. #define CMD_iunmap 49
  149.     {(char_u *)"iunabbrev",        EXTRA+TRLBAR+USECTRLV},
  150. #define CMD_iunabbrev 50
  151.     {(char_u *)"join",            RANGE+COUNT+TRLBAR},
  152. #define CMD_join 51
  153.     {(char_u *)"jumps",            TRLBAR},
  154. #define CMD_jumps 52
  155.     {(char_u *)"k",                RANGE+WORD1+TRLBAR},
  156. #define CMD_k 53
  157.     {(char_u *)"list",            RANGE+COUNT+TRLBAR},
  158. #define CMD_list 54
  159.     {(char_u *)"last",            EXTRA+BANG},
  160. #define CMD_last 55
  161.     {(char_u *)"left",            TRLBAR+RANGE+EXTRA},
  162. #define CMD_left 56
  163.     {(char_u *)"move",            RANGE+EXTRA+TRLBAR},
  164. #define CMD_move 57
  165.     {(char_u *)"mark",            RANGE+WORD1+TRLBAR},
  166. #define CMD_mark 58
  167.     {(char_u *)"marks",            TRLBAR},
  168. #define CMD_marks 59
  169.     {(char_u *)"map",            BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  170. #define CMD_map 60
  171.     {(char_u *)"make",            NEEDARG+EXTRA+TRLBAR+XFILE},
  172. #define CMD_make 61
  173.     {(char_u *)"mkexrc",        BANG+FILE1+TRLBAR},
  174. #define CMD_mkexrc 62
  175.     {(char_u *)"mkvimrc",        BANG+FILE1+TRLBAR},
  176. #define CMD_mkvimrc 63
  177.     {(char_u *)"mfstat",        TRLBAR},                /* for debugging */
  178. #define CMD_mfstat 64
  179.     {(char_u *)"mode",            WORD1+TRLBAR},
  180. #define CMD_mode 65
  181.     {(char_u *)"next",            RANGE+NOTADR+BANG+NAMEDFS},
  182. #define CMD_next 66
  183.     {(char_u *)"new",            BANG+FILE1+RANGE+NOTADR},
  184. #define CMD_new 67
  185.     {(char_u *)"number",        RANGE+COUNT+TRLBAR},
  186. #define CMD_number 68
  187.     {(char_u *)"#",                RANGE+COUNT+TRLBAR},
  188. #define CMD_pound 69
  189.     {(char_u *)"noremap",        BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  190. #define CMD_noremap 70
  191.     {(char_u *)"noreabbrev",    EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
  192. #define CMD_noreabbrev 71
  193.     {(char_u *)"Next",            EXTRA+RANGE+NOTADR+COUNT+BANG},
  194. #define CMD_Next 72
  195.     {(char_u *)"only",            BANG+TRLBAR},
  196. #define CMD_only 73
  197.     {(char_u *)"print",            RANGE+COUNT+TRLBAR},
  198. #define CMD_print 74
  199.     {(char_u *)"pop",            RANGE+NOTADR+COUNT+TRLBAR+ZEROR},
  200. #define CMD_pop 75
  201.     {(char_u *)"put",            RANGE+BANG+REGSTR+TRLBAR},
  202. #define CMD_put 76
  203.     {(char_u *)"preserve",        TRLBAR},
  204. #define CMD_preserve 77
  205.     {(char_u *)"previous",        EXTRA+RANGE+NOTADR+COUNT+BANG},
  206. #define CMD_previous 78
  207.     {(char_u *)"pwd",            TRLBAR},
  208. #define CMD_pwd 79
  209.     {(char_u *)"quit",            BANG+TRLBAR},
  210. #define CMD_quit 80
  211.     {(char_u *)"qall",            BANG+TRLBAR},
  212. #define CMD_qall 81
  213.     {(char_u *)"read",            RANGE+NAMEDF+TRLBAR+ZEROR},
  214. #define CMD_read 82
  215.     {(char_u *)"rewind",        EXTRA+BANG},
  216. #define CMD_rewind 83
  217.     {(char_u *)"recover",        FILE1+TRLBAR},                /* not supported */
  218. #define CMD_recover 84
  219.     {(char_u *)"redo",            TRLBAR},
  220. #define CMD_redo 85
  221.     {(char_u *)"right",            TRLBAR+RANGE+EXTRA},
  222. #define CMD_right 86
  223.     {(char_u *)"resize",        TRLBAR+WORD1},
  224. #define CMD_resize 87
  225.     {(char_u *)"substitute",    RANGE+EXTRA},
  226. #define CMD_substitute 88
  227.     {(char_u *)"sargument",        BANG+RANGE+NOTADR+COUNT+EXTRA},
  228. #define CMD_sargument 89
  229.     {(char_u *)"sall",            TRLBAR},
  230. #define CMD_sall 90
  231.     {(char_u *)"sbuffer",        RANGE+NOTADR+COUNT+TRLBAR},
  232. #define CMD_sbuffer 91
  233.     {(char_u *)"sball",            TRLBAR},
  234. #define CMD_sball 92
  235.     {(char_u *)"sbmodified",    RANGE+NOTADR+COUNT+TRLBAR},
  236. #define CMD_sbmodified 93
  237.     {(char_u *)"sbnext",        RANGE+NOTADR+COUNT+TRLBAR},
  238. #define CMD_sbnext 94
  239.     {(char_u *)"sbNext",        RANGE+NOTADR+COUNT+TRLBAR},
  240. #define CMD_sbNext 95
  241.     {(char_u *)"sbprevious",    RANGE+NOTADR+COUNT+TRLBAR},
  242. #define CMD_sbprevious 96
  243.     {(char_u *)"sbrewind",        TRLBAR},
  244. #define CMD_sbrewind 97
  245.     {(char_u *)"sblast",        TRLBAR},
  246. #define CMD_sblast 98
  247.     {(char_u *)"suspend",        TRLBAR+BANG},
  248. #define CMD_suspend 99
  249.     {(char_u *)"set",            EXTRA+TRLBAR},
  250. #define CMD_set 100
  251.     {(char_u *)"setkeymap",        NAMEDF+TRLBAR},
  252. #define CMD_setkeymap 101
  253.     {(char_u *)"shell",            TRLBAR},
  254. #define CMD_shell 102
  255.     {(char_u *)"sleep",            RANGE+COUNT+NOTADR+TRLBAR},
  256. #define CMD_sleep 103
  257.     {(char_u *)"source",        NAMEDF+NEEDARG+TRLBAR},
  258. #define CMD_source 104
  259.     {(char_u *)"split",            BANG+FILE1+RANGE+NOTADR},
  260. #define CMD_split 105
  261.     {(char_u *)"snext",            RANGE+NOTADR+BANG+NAMEDFS},
  262. #define CMD_snext 106
  263.     {(char_u *)"sNext",            EXTRA+RANGE+NOTADR+COUNT+BANG},
  264. #define CMD_sNext 107
  265.     {(char_u *)"sprevious",        EXTRA+RANGE+NOTADR+COUNT+BANG},
  266. #define CMD_sprevious 108
  267.     {(char_u *)"srewind",        EXTRA+BANG},
  268. #define CMD_srewind 109
  269.     {(char_u *)"slast",            EXTRA+BANG},
  270. #define CMD_slast 110
  271.     {(char_u *)"stop",            TRLBAR+BANG},
  272. #define CMD_stop 111
  273.     {(char_u *)"sunhide",        TRLBAR},
  274. #define CMD_sunhide 112
  275.     {(char_u *)"swapname",        TRLBAR},
  276. #define CMD_swapname 113
  277.     {(char_u *)"t",                RANGE+EXTRA+TRLBAR},
  278. #define CMD_t 114
  279.     {(char_u *)"tag",            RANGE+NOTADR+COUNT+BANG+WORD1+TRLBAR+ZEROR},
  280. #define CMD_tag 115
  281.     {(char_u *)"tags",            TRLBAR},
  282. #define CMD_tags 116
  283.     {(char_u *)"unabbreviate",    EXTRA+TRLBAR+USECTRLV},
  284. #define CMD_unabbreviate 117
  285.     {(char_u *)"undo",            TRLBAR},
  286. #define CMD_undo 118
  287.     {(char_u *)"unhide",        TRLBAR},
  288. #define CMD_unhide 119
  289.     {(char_u *)"unmap",            BANG+EXTRA+TRLBAR+USECTRLV},
  290. #define CMD_unmap 120
  291.     {(char_u *)"vglobal",        RANGE+EXTRA+DFLALL},
  292. #define CMD_vglobal 121
  293.     {(char_u *)"version",        TRLBAR},
  294. #define CMD_version 122
  295.     {(char_u *)"visual",        RANGE+BANG+FILE1},
  296. #define CMD_visual 123
  297.     {(char_u *)"write",            RANGE+BANG+FILE1+DFLALL+TRLBAR},
  298. #define CMD_write 124
  299.     {(char_u *)"wnext",            RANGE+NOTADR+BANG+FILE1+TRLBAR},
  300. #define CMD_wnext 125
  301.     {(char_u *)"wNext",            RANGE+NOTADR+BANG+FILE1+TRLBAR},
  302. #define CMD_wNext 126
  303.     {(char_u *)"wprevious",        RANGE+NOTADR+BANG+FILE1+TRLBAR},
  304. #define CMD_wprevious 127
  305.     {(char_u *)"winsize",        EXTRA+NEEDARG+TRLBAR},
  306. #define CMD_winsize 128
  307.     {(char_u *)"wq",            BANG+FILE1+DFLALL+TRLBAR},
  308. #define CMD_wq 129
  309.     {(char_u *)"wall",            BANG+TRLBAR},
  310. #define CMD_wall 130
  311.     {(char_u *)"wqall",            BANG+FILE1+DFLALL+TRLBAR},
  312. #define CMD_wqall 131
  313.     {(char_u *)"xit",            BANG+FILE1+DFLALL+TRLBAR},
  314. #define CMD_xit 132
  315.     {(char_u *)"xall",            BANG+TRLBAR},
  316. #define CMD_xall 133
  317.     {(char_u *)"yank",            RANGE+REGSTR+COUNT+TRLBAR},
  318. #define CMD_yank 134
  319.     {(char_u *)"z",                RANGE+COUNT+TRLBAR},        /* not supported */
  320. #define CMD_z 135
  321.     {(char_u *)"@",                RANGE+EXTRA+TRLBAR},
  322. #define CMD_at 136
  323.     {(char_u *)"!",                RANGE+NAMEDFS},
  324. #define CMD_bang 137
  325.     {(char_u *)"<",                RANGE+COUNT+TRLBAR},
  326. #define CMD_lshift 138
  327.     {(char_u *)">",                RANGE+COUNT+TRLBAR},
  328. #define CMD_rshift 139
  329.     {(char_u *)"=",                RANGE+TRLBAR},
  330. #define CMD_equal 140
  331.     {(char_u *)"&",                RANGE+EXTRA},
  332. #define CMD_and 141
  333.     {(char_u *)"~",                RANGE+EXTRA}
  334. #define CMD_tilde 142
  335. #define CMD_SIZE 143
  336.  
  337. };
  338.